<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@page import="dto.TicketDTO"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Pagar Factura Efectivo</title>
<script type="text/javascript">
function validate(evt) {
	  var theEvent = evt || window.event;
	  var key = theEvent.keyCode || theEvent.which;
	  key = String.fromCharCode( key );
	  var regex = /[0-9]|\./;
	  if( !regex.test(key) ) {
	    theEvent.returnValue = false;
	    if(theEvent.preventDefault) theEvent.preventDefault();
	  }
	}
</script>
<link rel="stylesheet" href="css/estilo.css" type="text/css">
<%

if(request.getAttribute("resultado")!=null){
	TicketDTO resultado=(TicketDTO)request.getAttribute("resultado");
	if(resultado.getId()!=0){
		String id=String.valueOf(resultado.getId());
%>
		<script type="text/javascript">
		alert("Se creo el pago ID: <%= id%>");
		window.location="index.jsp";
		</script>
	<%}
	else{
	 %>
		<script type="text/javascript">
		alert("Error en el pago ");
		</script>
	<%
	}
}

%>

</head>
<h1>Pagar Factura Ticket</h1>
<body>
	<form action="PagarFacturaTicket" method=post onsubmit="return confirm('Desea confirmar el pago?');" >
	Ingrese el ticket con el monto total del pago:
	<p>
	<p>Numero de Mesa: <input type="text" name="nroMesa" value="0" onkeypress="validate(event)" maxlength="3"/></p>
	<p>
	<TABLE id="dataTable"   border="1" align="center">
		<tr>
			<th></th>
			<th>Empresa</th>
			<th>Tipo Tarjeta</th>
			<th>Monto</th>
		</tr>
          <TR>
               <TD><INPUT type="checkbox" NAME="chk"/></TD>
               <TD> <INPUT type="text" name="nombreEmpresa" /> </TD>
               <TD> <INPUT type="text" name="tipoTarjeta"/> </TD>
               <TD> <INPUT type="text" name="valor" onkeypress="validate(event)" value="0" maxlength="20"/> </TD>
          </TR>

     </TABLE>


<p><input type="submit" name="submit" value="Pagar Factura"/></p>

</form>
</body>
</html>